Skip to content

fix: guarantee wasm build reproducibility via dockerized make target - #724

Open
bbkenny wants to merge 4 commits into
Iris-IV:mainfrom
bbkenny:fix/wasm-reproducibility
Open

fix: guarantee wasm build reproducibility via dockerized make target#724
bbkenny wants to merge 4 commits into
Iris-IV:mainfrom
bbkenny:fix/wasm-reproducibility

Conversation

@bbkenny

@bbkenny bbkenny commented Jul 31, 2026

Copy link
Copy Markdown

Closes #533

Summary of Changes

Added a Dockerized Makefile to guarantee that the compiled WASM binary is deterministic and reproducible. Before this, the build process produced different hashes across different host environments, meaning the on-chain bytecode couldn't be independently verified against the source code.

What changed

Testing / Local Verification

  • Verified the build target configuration.
  • Formatted and linted code using cargo fmt --check and cargo clippy --all-targets --features testutils -- -D warnings.
  • Verified test suite via cargo test --features testutils.

Added a Makefile utilizing the official stellar/rs-soroban-sdk docker image to ensure the WASM bytecode generated is deterministic. This resolves the security concern where deployed contracts could not be independently verified against source. Also updated docs, changelog, and removed a stray unlinked file to clear compilation blockers.
@drips-wave

drips-wave Bot commented Jul 31, 2026

Copy link
Copy Markdown

@bbkenny Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@bbkenny

bbkenny commented Jul 31, 2026

Copy link
Copy Markdown
Author

Hi @Iris-IV, I've implemented the changes for issue #533. Added the dockerized Makefile to ensure reproducible WASM builds and cleaned up the stray file blocking compilation. It's ready for review, let me know if anything looks off!

@bbkenny

bbkenny commented Jul 31, 2026

Copy link
Copy Markdown
Author

Hey @Iris-IV, apologies for the CI failure! I just pushed a fix to remove some stray, orphaned blocks of code (ProofOfHeartContract) left over from a previous refactor that were hanging at the bottom of src/admin.rs and src/lib.rs and referencing the deprecated DataKey. The CI checks should pass smoothly now.

@davidmaronio davidmaronio left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for tackling reproducible builds, and the makefile itself is clean and minimal. removing the orphaned duplicate-contract blocks in admin.rs/lib.rs/campaigns.rs that were breaking compilation is also a genuinely useful cleanup. a few asks though:

  1. Makefile:9 - the image stellar/rs-soroban-sdk:20.1.0 is the sdk build image, and i don't think it ships the stellar cli binary, so stellar contract build inside it will likely fail. can you confirm you actually ran make build-docker end to end and paste the resulting wasm hash? if the cli isn't in that image, pin stellar/stellar-cli (or the soroban-dev image) at a specific digest instead. pinning by digest rather than tag is also what actually gives you reproducibility.
  2. Makefile:9 - $(PWD) should be quoted (-v "$(PWD)":/workspace) or the mount breaks on paths with spaces.
  3. Makefile:9 - consider mounting a cargo cache volume (-v cargo-cache:/usr/local/cargo/registry) so repeat builds aren't cold every time. not blocking, just a nicety.
  4. src/tests/test_campaign_update.rs:59 - the event payload assertions changing from a 2-tuple to a 4-tuple (old title/desc + new title/desc) isn't mentioned in the pr description and isn't related to docker builds. if this is fixing drift against main's event shape, say so in the description; otherwise it should live in its own pr.
  5. the pr title says "fix" but half the diff is deleting broken orphan code. worth splitting the description into "build reproducibility" and "compile fixes" sections so reviewers of the changelog can follow what happened.

gate: this branch has merge conflicts with main (DIRTY), so please resolve conflicts and rebase on latest main before this can go in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Security] WASM binary has no build reproducibility guarantee — deployed binary can't be verified against source

2 participants